﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Pasteur
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            PasteurSettings.myPrefs.Load();

            checkBoxTier1.Checked = PasteurSettings.myPrefs.chckTier1;
            checkBoxTier2.Checked = PasteurSettings.myPrefs.chckTier2;
            checkBoxTier3.Checked = PasteurSettings.myPrefs.chckTier3;
            checkBoxTier4.Checked = PasteurSettings.myPrefs.chckTier4;
            checkBoxTier5.Checked = PasteurSettings.myPrefs.chckTier5;
            checkBoxTier6.Checked = PasteurSettings.myPrefs.chckTier6;
            checkBoxAlchFlask.Checked = PasteurSettings.myPrefs.AlchFlask;
            checkBoxDisableMovement.Checked = PasteurSettings.myPrefs.DisableAllMovement;
            checkBoxFearWard.Checked = PasteurSettings.myPrefs.fearward;
            checkBoxVoidTendrill.Checked = PasteurSettings.myPrefs.tendrillscreamcombo;
            checkBoxsilence.Checked = PasteurSettings.myPrefs.UseSilence;
            checkBoxFacing.Checked = PasteurSettings.myPrefs.DisableFacing;
            checkBoxLifeblood.Checked = PasteurSettings.myPrefs.UseLifeblood;
            checkBoxPsyScream.Checked = PasteurSettings.myPrefs.psyscream;
            checkBoxMSnotOnBosses.Checked = PasteurSettings.myPrefs.NoMindSearOnBosses;


            numericUpDownUseAOE.Value = new decimal(PasteurSettings.myPrefs.Aoe);
            numericUpDownShadowfeindMindbender.Value = new decimal(PasteurSettings.myPrefs.ShadowfeindMindbender);
            numericUpDownLikeBosses.Value = new decimal(PasteurSettings.myPrefs.likebosses);
            numericUpDownRenew.Value = new decimal(PasteurSettings.myPrefs.renew);
            numericUpDownFlash.Value = new decimal(PasteurSettings.myPrefs.flash);
            numericUpDownPWS.Value = new decimal(PasteurSettings.myPrefs.pws);
            numericUpDownWaterSpirit.Value = new decimal(PasteurSettings.myPrefs.waterspirit);
            numericUpDownLifeSpirit.Value = new decimal(PasteurSettings.myPrefs.lifespirit);
            numericUpDownHealthstone.Value = new decimal(PasteurSettings.myPrefs.healthstone);
            numericUpDownVampiricTouch.Value = new decimal(PasteurSettings.myPrefs.vamirictouch);
            numericUpDownDevouringPlague.Value = new decimal(PasteurSettings.myPrefs.devouringplague);
            numericUpDownDrinkMana.Value = new decimal(PasteurSettings.myPrefs.drinkmana);
            numericUpDownpartyPlague.Value = new decimal(PasteurSettings.myPrefs.partyplague);

            if (PasteurSettings.myPrefs.Tier1 == "Void Tendrils")
            {
                radioButtonVoidTendrils.Select();
            }
            else if (PasteurSettings.myPrefs.Tier1 == "Psyfiend")
            {
                radioButtonPsyfiend.Select();
            }
            else if (PasteurSettings.myPrefs.Tier1 == "Dominate Mind")
            {
                radioButtonDominateMind.Select();
            }
            if (PasteurSettings.myPrefs.Tier2 == "Body and Soul")
            {
                radioButtonBodyandSoul.Select();
            }
            else if (PasteurSettings.myPrefs.Tier2 == "Angelic Feather")
            {
                radioButtonAngelicFeather.Select();
            }
            else if (PasteurSettings.myPrefs.Tier2 == "Phantasm")
            {
                radioButtonPhantasm.Select();
            }
            if (PasteurSettings.myPrefs.Tier3 == "Darkness Light")
            {
                radioButtonFromDarknessComesLight.Select();
            }
            else if (PasteurSettings.myPrefs.Tier3 == "Mindbender")
            {
                radioButtonMindbender.Select();
            }
            else if (PasteurSettings.myPrefs.Tier3 == "Power Word Solace")
            {
                radioButtonPowerWordSolace.Select();
            }
            if (PasteurSettings.myPrefs.Tier4 == "Desperate Prayer")
            {
                radioButtonDesperatePrayer.Select();
            }
            else if (PasteurSettings.myPrefs.Tier4 == "Spectral Guise")
            {
                radioButtonSpectralGuise.Select();
            }
            else if (PasteurSettings.myPrefs.Tier4 == "Angelic Bulwark")
            {
                radioButtonAngelicBulwark.Select();
            }
            if (PasteurSettings.myPrefs.Tier5 == "Twist of Fate")
            {
                radioButtonTwistofFate.Select();
            }
            else if (PasteurSettings.myPrefs.Tier5 == "Power Infusion")
            {
                radioButtonPowerInfusion.Select();
            }
            else if (PasteurSettings.myPrefs.Tier5 == "Divine Insight")
            {
                radioButtonDivineInsight.Select();
            }
            if (PasteurSettings.myPrefs.Tier6 == "Cascade")
            {
                radioButtonCascade.Select();
            }
            else if (PasteurSettings.myPrefs.Tier6 == "Divine Star")
            {
                radioButtonDivineStar.Select();
            }
            else if (PasteurSettings.myPrefs.Tier6 == "Halo")
            {
                radioButtonHalo.Select();
            }
            if (PasteurSettings.myPrefs.Trinket1 == "always")
            {
                radioButtonTrinket1A.Select();
            }
            else if (PasteurSettings.myPrefs.Trinket1 == "never")
            {
                radioButtonTrinket1N.Select();
            }
            else if (PasteurSettings.myPrefs.Trinket1 == "boss")
            {
                radioButtonTrinket1B.Select();
            }
            if (PasteurSettings.myPrefs.Trinket2 == "always")
            {
                radioButtonTrinket2A.Select();
            }
            else if (PasteurSettings.myPrefs.Trinket2 == "never")
            {
                radioButtonTrinket2N.Select();
            }
            else if (PasteurSettings.myPrefs.Trinket2 == "boss")
            {
                radioButtonTrinket2B.Select();
            }
            if (PasteurSettings.myPrefs.MindSear == "party")
            {
                radioButtonMSparty.Select();
            }
            else if (PasteurSettings.myPrefs.MindSear == "always")
            {
                radioButtonMSalways.Select();
            }
        }

        private void radioButtonVoidTendrils_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier1 = "Void Tendrils";
        }

        private void radioButtonPsyfiend_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier1 = "Psyfiend";
        }

        private void radioButtonDominateMind_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier1 = "Dominate Mind";
        }

        private void radioButtonBodyandSoul_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier2 = "Body and Soul";
        }

        private void radioButtonAngelicFeather_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier2 = "Angelic Feather";
        }

        private void radioButtonPhantasm_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier2 = "Phantasm";
        }

        private void radioButtonFromDarknessComesLight_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier3 = "Darkness Light";
        }

        private void radioButtonMindbender_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier3 = "Mindbender";
        }

        private void radioButtonPowerWordSolace_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier3 = "Power Word Solace";
        }

        private void radioButtonDesperatePrayer_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier4 = "Desperate Prayer";
        }

        private void radioButtonSpectralGuise_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier4 = "Spectral Guise";
        }

        private void radioButtonAngelicBulwark_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier4 = "Angelic Bulwark";
        }

        private void radioButtonTwistofFate_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier5 = "Twist of Fate";
        }

        private void radioButtonPowerInfusion_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier5 = "Power Infusion";
        }

        private void radioButtonDivineInsight_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier5 = "Divine Insight";
        }

        private void radioButtonCascade_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier6 = "Cascade";
        }

        private void radioButtonDivineStar_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier6 = "Divine Star";
        }

        private void radioButtonHalo_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Tier6 = "Halo";
        }

        private void checkBoxTier1_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier1 = checkBoxTier1.Checked;
        }

        private void checkBoxTier2_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier2 = checkBoxTier2.Checked;
        }

        private void checkBoxTier3_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier3 = checkBoxTier3.Checked;
        }

        private void checkBoxTier4_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier4 = checkBoxTier4.Checked;
        }

        private void checkBoxTier5_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier5 = checkBoxTier5.Checked;
        }

        private void checkBoxTier6_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.chckTier6 = checkBoxTier6.Checked;
        }

        private void buttonSaveAll_Click(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Save();
            Close();
        }

        private void buttonSaveTalents_Click(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Save();
        }

        private void numericUpDownUseAOE_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Aoe = (int)numericUpDownUseAOE.Value;
        }

        private void numericUpDownShadowfeindMindbender_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.ShadowfeindMindbender = (int)numericUpDownShadowfeindMindbender.Value;
        }

        private void numericUpDownLikeBosses_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.likebosses = (int)numericUpDownLikeBosses.Value;
        }

        private void numericUpDownRenew_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.renew = (int)numericUpDownRenew.Value;
        }

        private void numericUpDownFlash_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.flash = (int)numericUpDownFlash.Value;
        }

        private void numericUpDownPWS_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.pws = (int)numericUpDownPWS.Value;
        }

        private void buttonSaveSettings_Click(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Save();
        }

        private void numericUpDownWaterSpirit_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.waterspirit = (int)numericUpDownWaterSpirit.Value;
        }

        private void numericUpDownLifeSpirit_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.lifespirit = (int)numericUpDownLifeSpirit.Value;
        }

        private void numericUpDownHealthstone_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.healthstone = (int)numericUpDownHealthstone.Value;
        }

        private void numericUpDownVampiricTouch_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.vamirictouch = (int)numericUpDownVampiricTouch.Value;
        }

        private void numericUpDownDevouringPlague_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.devouringplague = (int)numericUpDownDevouringPlague.Value;
        }

        private void radioButtonTrinket1A_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket1 = "always";
        }

        private void radioButtonTrinket1N_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket1 = "never";
        }

        private void radioButtonTrinket1B_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket1 = "boss";
        }

        private void radioButtonTrinket2A_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket2 = "always";
        }

        private void radioButtonTrinket2N_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket2 = "never";
        }

        private void radioButtonTrinket2B_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Trinket2 = "boss";
        }

        private void checkBoxAlchFlask_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.AlchFlask = checkBoxAlchFlask.Checked;
        }

        private void checkBoxDisableMovement_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.DisableAllMovement = checkBoxDisableMovement.Checked;
        }

        private void radioButtonMSalways_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.MindSear = "always";
        }

        private void radioButtonMSparty_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.MindSear = "party";
        }

        private void numericUpDownDrinkMana_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.drinkmana = (int)numericUpDownDrinkMana.Value;
        }

        private void checkBoxFearWard_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.fearward = checkBoxFearWard.Checked;
        }

        private void numericUpDownpartyPlague_ValueChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.partyplague = (int)numericUpDownpartyPlague.Value;
        }

        private void buttonSaveMiscStuff_Click(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.Save();
        }

        private void checkBoxVoidTendrill_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.tendrillscreamcombo = checkBoxVoidTendrill.Checked;
        }

        private void checkBoxsilence_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.UseSilence = checkBoxsilence.Checked;
        }

        private void checkBoxFacing_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.DisableFacing = checkBoxFacing.Checked;
        }

        private void checkBoxAlchFlask_CheckedChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.AlchFlask = checkBoxAlchFlask.Checked;
        }

        private void numericUpDownHealthstone_ValueChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.healthstone = (int)numericUpDownHealthstone.Value;
        }

        private void numericUpDownWaterSpirit_ValueChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.waterspirit = (int)numericUpDownWaterSpirit.Value;
        }

        private void numericUpDownLifeSpirit_ValueChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.lifespirit = (int)numericUpDownLifeSpirit.Value;
        }

        private void checkBoxLifeblood_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.UseLifeblood = checkBoxLifeblood.Checked;
        }

        private void checkBoxPsyScream_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.psyscream = checkBoxPsyScream.Checked;
        }

        private void checkBoxMSnotOnBosses_CheckedChanged(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.NoMindSearOnBosses = checkBoxMSnotOnBosses.Checked;
        }

        private void numericUpDownVampiricTouch_ValueChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.vamirictouch = (int)numericUpDownVampiricTouch.Value;
        }

        private void numericUpDownDevouringPlague_ValueChanged_1(object sender, EventArgs e)
        {
            PasteurSettings.myPrefs.devouringplague = (int)numericUpDownDevouringPlague.Value;
        }


    }
}
